﻿#pragma once

#include "AsyncLibDef.h"

namespace AsyncLib
{

class CTaskThread
{
public:
	CTaskThread();
	virtual ~CTaskThread();

	CTaskThread(const CTaskThread&) = delete;
	CTaskThread& operator=(const CTaskThread&) = delete;

	virtual void Stop() = 0;
	virtual void Exit() = 0;
	virtual void PostTask(std::function<void()>&& fnTask) = 0;

protected:
	std::mutex m_mutex;
	std::deque<std::function<void()>> m_deqTasks;
};

} // namespace AsyncLib
